/**
 * Yolema.com Inc.
 * Copyright (c) 2011-2012 All Rights Reserved.
 */
package org.grayrabbit.pay.core.service.system;

import java.util.List;
import org.grayrabbit.pay.core.model.pages.PageList;
import org.grayrabbit.pay.core.model.entity.system.TradeTerminal;

/**
 * 
 * 
 * @author liyd
 * @version $Id: TradeTerminalService.java, v 0.1 Sat Jun 02 22:00:25 CST 2012 liyd Exp $
 */
public interface TradeTerminalService {

    /**
     * 查询业务对象列表
     * 
     * @param tradeTerminal
     * @return
     */
    public PageList<TradeTerminal> queryPageList(TradeTerminal tradeTerminal);

    /**
     * 根据Id得到实体对象
     * 
     * @param id
     * @return
     */
    public TradeTerminal getById(Long id);

    /**
     * 根据id批量删除
     * 
     * @param idArray
     */
    public void deleteBatchById(Long[] idArray);

    /**
     * 查询所有对象
     * 
     * @return
     */
    public List<TradeTerminal> findAll();

    /**
     * 查询所有可用的终端
     * @return
     */
    public List<TradeTerminal> findEnabledTerminals();

    /**
     * 添加一个对象
     * 
     * @param tradeTerminal
     */
    public void insert(TradeTerminal tradeTerminal);

    /**
     * 更新一个对象
     * 
     * @param tradeTerminal
     * @return
     */
    public int update(TradeTerminal tradeTerminal);

    /**
     * 更改状态
     * @param tradeTerminal
     * @return
     */
    public int changeStatus(TradeTerminal tradeTerminal);

    /**
     * 根据终端的code得到记录条数，判重
     * @param terminalCode
     * @return
     */
    public int getCountByTerminalCode(String terminalCode);
    
    /**
     * 根据终端code来获取对应的终端，没找到，返回null
     * 
     * @param terminalCode
     * @return
     */
    public TradeTerminal getByTerminalCode(String terminalCode);

    /**
     * 删除一个对象
     * 
     * @param tradeTerminal
     */
    public void delete(TradeTerminal tradeTerminal);

}
